package com.mapper;

import com.pojo.SClass;
import com.pojo.SStudent;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
* @author 海棠凤梨
* @description 针对表【s_student】的数据库操作Mapper
* @createDate 2024-11-20 09:38:24
* @Entity com.pojo.SStudent
*/
public interface SStudentMapper {

    int deleteByPrimaryKey(Long id);

    int insert(SStudent record);

    int insertSelective(SStudent record);

    SStudent selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SStudent record);

    int updateByPrimaryKey(SStudent record);

    @Update("update s_student set name = #{name},age = #{age},cid = #{cid}"+" where id = #{id}")
    int updateStudents(SStudent record);

    @Select("select * from s_student where cid = #{id}")
    @Results({
            @Result(id = true,column = "id",property = "id"),
            @Result(column = "name",property = "name"),
            @Result(column = "sge",property = "age"),
    })
    List<SStudent> selectStudentsByUserId(int id);

    @Select("select * from s_student where cid=#{id}")
    SStudent selectSStudentById(int id);
}
